package com.common.ui.recycleview.decoration;

import android.graphics.Rect;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;

public class SmallVideoItemDecoration extends RecyclerView.ItemDecoration{

    private int space;

    public SmallVideoItemDecoration(int space) {
        this.space = space;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        if (parent.getChildLayoutPosition(view) %2 ==0) {
            outRect.set(space,0,space,0);
        }else {
            outRect.set(0,0,space,0);
        }
    }
}
